


clear all
import sas "/projects/users/########/cnty_level_ivs.sas7bdat", case(lower)
egen cty = group(ctyfips)
xtset cty year

gen wspeed2 = meanspd^2
gen wspeed3 = meanspd^3

* Kitchen sink model for predicted capacity-by-year at location: 
xtreg c_tcap c.cond_exp_ycap##(c.meanspd c.wspeed2 c.wspeed3) c.cond_exp_ytnum##(c.meanspd c.wspeed2 c.wspeed3)  c.usturbcap##(c.meanspd c.wspeed2 c.wspeed3) c.usturbnum##(c.meanspd c.wspeed2 c.wspeed3) c.usplntnum##(c.meanspd c.wspeed2 c.wspeed3) c.usturbcap_new##(c.meanspd c.wspeed2 c.wspeed3) c.usturbnum_new##(c.meanspd c.wspeed2 c.wspeed3) c.usplntnum_new##(c.meanspd c.wspeed2 c.wspeed3) i.year, fe

predict zhat_cnty, xb
save "/projects/users/########/cnty_level_ivs2.dta", replace
